package com.wuxiaofan.coupon.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.coupon.entity.SmsSeckillSkuNotice;
import com.wuxiaofan.coupon.entity.custom.SmsSeckillSkuNoticeCustom;
import com.wuxiaofan.coupon.mapper.SmsSeckillSkuNoticeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.coupon.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class SmsSeckillSkuNoticeService {
    @Autowired
    private SmsSeckillSkuNoticeMapper smsSeckillSkuNoticeMapper;
    @Resource
    private Idgenerator idgenerator;
    public SmsSeckillSkuNotice findById(String id){
        return smsSeckillSkuNoticeMapper.selectById(id);
    }

    public SmsSeckillSkuNoticeCustom findCountByMap(Map paraMap){
        return smsSeckillSkuNoticeMapper.findCountByMap(paraMap);
    }

    public SmsSeckillSkuNoticeCustom findGroupByMap(Map paraMap){
        return smsSeckillSkuNoticeMapper.findGroupByMap(paraMap);
    }

    public List<SmsSeckillSkuNoticeCustom> findByMap(Map paraMap){
        return smsSeckillSkuNoticeMapper.findByMap(paraMap);
    }

    public Page<SmsSeckillSkuNoticeCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(smsSeckillSkuNoticeMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        smsSeckillSkuNoticeMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        smsSeckillSkuNoticeMapper.deleteById(id);
    }

    public SmsSeckillSkuNotice save(SmsSeckillSkuNotice smsSeckillSkuNotice){
        smsSeckillSkuNotice.setId(idgenerator.getId());
        smsSeckillSkuNoticeMapper.insert(smsSeckillSkuNotice);
        return smsSeckillSkuNotice;
    }

}
